<!-- 系统自动生成 Date:2021-02-21 22:43 -->
<#include "/common/defaultEngine.html"/>
<@pageTheme mark="${config.optimize()?string('true', 'false')}">
    <@header title="系统消息" bodyClass="gray-bg animated fadeInRight" isAnimation=false libs=["table","zTree","layout-latest"]/>
    <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <@f.form id="msg-form" class="form-inline">
                    <div class="select-list">
                        <ul>
                            <li>
                                <label> ${i18n("消息标题")}：</label>
                                <@f.input  name="msgTitle"/>
                            </li>
                            <li>
                                <label> ${i18n("消息等级")}： </label>
                                <@f.select name="msgLevel" dictType="sys_notice_level" blankValue="" blankLabel="所有"/>
                            </li>
                            <li>
                                <label> ${i18n("是否开放评论")}： </label>
                                <@f.select name="isComments" dictType="sys_normal_disable" blankValue="" blankLabel="所有"/>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;&nbsp;${i18n("查询")}</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="opt.form.reset()"><i class="fa fa-refresh"></i>&nbsp;${i18n("重置")}</a>
                            </li>
                        </ul>
                    </div>
                </@f.form>
            </div>
            <@table id="bootstrap-table"/>
        </div>
    </div>
    <@footer>
        <script type="text/javascript">
            var editFlag = "${permission.hasPermi("sys:msg:edit")}";
            var listFlag = "${permission.hasPermi("sys:msg:add")}";
            var delFlag = "${permission.hasPermi("sys:msg:del")}";
            var visible = ${permission.isPermitteds("sys:msg:edit,sys:msg:del,sys:msg:add")?string('true', 'false')};
            var msgLevelDatas = ${dict.getDictListJson('sys_notice_level')};
            var isCommentsDatas = ${dict.getDictListJson('sys_msg_comments')};
            var prefix = baseURL + "sys/msg";

            $(function() {
                var options = {
                    url: prefix + "/userList",
                    editUrl: prefix + "/pushView/{id}",
                    modalName: "${i18n("内部消息")}",
                    clickToSelect: false,
                    uniqueId:  'id',/* 唯一ID */
                    escape: true,/* 分页设置 */
                    showPageGo: true,/* 分页设置 */
                    pageSize: 10,/* 分页设置 */
                    pageList: [10, 30, 50],/* 分页设置 */
                    columns:[
                        {title: $.i18n.prop("序号"), width: 5, align: "center", formatter: function (value, row, index) {
                                return $.table.serialNumber(index);
                            }}
                        ,{field : 'id',title : '${i18n("编号")}',visible: false}
                        ,{field : 'msgTitle',title : '${i18n("消息标题")}'}
                        ,{field : 'msgLevel',title : '${i18n("消息等级")}',formatter: function(value, row, index) {
                                return opt.common.selectDictLabels(msgLevelDatas, value);
                            }}
                        ,{field : 'isComments',title : '${i18n("是否开放评论")}',formatter: function(value, row, index) {
                                return opt.common.selectDictLabels(isCommentsDatas, value);
                            }}
                        ,{field : 'isRead',title : '${i18n("是否阅读")}',formatter: function(value, row, index) {
                                return $.i18n.text(value == "0" ? '未阅读' : '已阅读');
                            }}
                        ,{field : 'pushDate',title : '${i18n("接收时间")}'}
                        ,{title:"${i18n("操作")}",align: 'center',formatter: function(value, row, index) {
                                var actions = [];
                                actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="opt.operate.editTab(\'' + row.id + '\',\'查看\')"><i class="fa fa-eye"></i> ${i18n("查看")}</a> ');
                                return actions.join('');
                        }}
                    ]
                };
                $.table.init(options);
            });

            function openView(id,editFlag){
                opt.operate.view(id,editFlag,opt.operate.edit);
            }
        </script>
    </@footer>
</@pageTheme>